export let getStore = (key) => {
	return new Promise((resolve) => {
		try {
			var value = wx.getStorageSync(key)
			if (value) {
				// Do something with return value
				resolve({
					status: true,
					code: 200,
					message: '查询成功'
				})
				return
			} else {
				resolve({
					status: true,
					code: 400,
					message: '未找到'
				})
			}
		} catch (e) {
			// Do something when catch error
			resolve({
				status: true,
				code: 503,
				message: e
			})
		}
	})
}

export let setStore = (key, value) => {
	
	console.log(key, value, 'key, value')
	
	
	return new Promise((resolve) => {
		
		try {
			var res = wx.setStorageSync(key, value)
			resolve({
				status: true,
				code: 200,
				message: '设置成功'
			})
		} catch (e) {
			// Do something when catch error
			console.log(e,'e')
			resolve({
				status: true,
				code: 503,
				message: e
			})
		}
	})
}